using System;
using DevExpress.Xpo;

namespace ChuanPlus{

    public class Customer : XPLiteObject
    {
        int fCustomerID;
        [Key(true)]
        public int CustomerID
        {
            get { return fCustomerID; }
            set { SetPropertyValue<int>("CustomerID", ref fCustomerID, value); }
        }
        string fCustomerName;
        [Size(50)]
        public string CustomerName
        {
            get { return fCustomerName; }
            set { SetPropertyValue<string>("CustomerName", ref fCustomerName, value); }
        }
        string fCustomerAdd;
        [Size(SizeAttribute.Unlimited)]
        public string CustomerAdd
        {
            get { return fCustomerAdd; }
            set { SetPropertyValue<string>("CustomerAdd", ref fCustomerAdd, value); }
        }
        string fCustomerPhone;
        public string CustomerPhone
        {
            get { return fCustomerPhone; }
            set { SetPropertyValue<string>("CustomerPhone", ref fCustomerPhone, value); }
        }
        string fCustomerFax;
        public string CustomerFax
        {
            get { return fCustomerFax; }
            set { SetPropertyValue<string>("CustomerFax", ref fCustomerFax, value); }
        }
        double fCreditLimit;
        public double CreditLimit
        {
            get { return fCreditLimit; }
            set { SetPropertyValue<double>("CreditLimit", ref fCreditLimit, value); }
        }
        double fCredit;
        public double Credit
        {
            get { return fCredit; }
            set { SetPropertyValue<double>("Credit", ref fCredit, value); }
        }
        string fOwnerName;
        [Size(50)]
        public string OwnerName
        {
            get { return fOwnerName; }
            set { SetPropertyValue<string>("OwnerName", ref fOwnerName, value); }
        }
        string fOwnerCellPhone;
        [Size(15)]
        public string OwnerCellPhone
        {
            get { return fOwnerCellPhone; }
            set { SetPropertyValue<string>("OwnerCellPhone", ref fOwnerCellPhone, value); }
        }
        string fAccountantName;
        [Size(50)]
        public string AccountantName
        {
            get { return fAccountantName; }
            set { SetPropertyValue<string>("AccountantName", ref fAccountantName, value); }
        }
        string fAccountantCellPhone;
        [Size(15)]
        public string AccountantCellPhone
        {
            get { return fAccountantCellPhone; }
            set { SetPropertyValue<string>("AccountantCellPhone", ref fAccountantCellPhone, value); }
        }
        string fPaymentTerm;
        [Size(10)]
        public string PaymentTerm
        {
            get { return fPaymentTerm; }
            set { SetPropertyValue<string>("PaymentTerm", ref fPaymentTerm, value); }
        }
        public Customer(Session session) : base(session) { }
        public Customer() : base(Session.DefaultSession) { }
        /// <summary>
        /// Initializes a new instance of the Customer class.
        /// </summary>
        /// <param name="session"></param>
        /// <param name="fCustomerID"></param>
        /// <param name="fCustomerName"></param>
        /// <param name="fCustomerAdd"></param>
        /// <param name="fCustomerPhone"></param>
        /// <param name="fCustomerFax"></param>
        /// <param name="fCreditLimit"></param>
        /// <param name="fCredit"></param>
        /// <param name="fOwnerName"></param>
        /// <param name="fOwnerCellPhone"></param>
        /// <param name="fAccountantName"></param>
        /// <param name="fAccountantCellPhone"></param>
        /// <param name="fPaymentTerm"></param>
        public Customer(Session session, string fCustomerName, string fCustomerAdd, string fCustomerPhone, string fCustomerFax, double fCreditLimit, double fCredit, string fOwnerName, string fOwnerCellPhone, string fAccountantName, string fAccountantCellPhone, string fPaymentTerm)
            : base(session)
        {
            
            this.fCustomerName = fCustomerName;
            this.fCustomerAdd = fCustomerAdd;
            this.fCustomerPhone = fCustomerPhone;
            this.fCustomerFax = fCustomerFax;
            this.fCreditLimit = fCreditLimit;
            this.fCredit = fCredit;
            this.fOwnerName = fOwnerName;
            this.fOwnerCellPhone = fOwnerCellPhone;
            this.fAccountantName = fAccountantName;
            this.fAccountantCellPhone = fAccountantCellPhone;
            this.fPaymentTerm = fPaymentTerm;
        }

        public override void AfterConstruction() { base.AfterConstruction(); }
        public override string ToString()
        {
            return CustomerName;
        }
    }

    
}